package com.cheng.example.book.advise151.chap1;

import java.util.HashMap;
import java.util.Map;

/**
 * 别让null值和空值威胁到变长方法
 */
public class Client05{

        public void methodA(String str, Integer... is) {
        }

        public void methodA(String str, String... strs) {
        }

        public static void main(String[] args) {
            Client05 client5 = new Client05();
            client5.methodA("china", 0);
            client5.methodA("china", "people");

            String strs[] = null;
            client5.methodA("china", strs);
            //            client5.methodA("china", null);

//            client5.methodA("china");
        }
}

/**
 * 测试map
 */
 class Client05_01{
    public void methodA(String str, Map map) {
    }

    public void methodA(String str, HashMap map) {
    }

    public static void main(String[] args) {
        Client05_01 client5 = new Client05_01();
        Map hashMap = new HashMap();
        client5.methodA("china", hashMap );
    }
}

